package com.moji.controller.web;


import com.moji.common.base.ApiResult;
import com.moji.entity.MjNews;
import com.moji.entity.MjSupportHelp;
import com.moji.entity.dto.QueryNewsDto;
import com.moji.entity.dto.QuerySupportHelpDto;
import com.moji.service.MjNewsService;
import com.moji.service.MjSupportHelpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 新闻中心表 前端控制器
 * </p>
 *
 * @author ccl
 * @since 2024-07-28
 */
@RestController
@RequestMapping("/web/mjNews")
@Api(tags = "新闻中心web相关接口", value = "新闻中心web相关接口")
public class MjNewsController {

    @Resource
    private MjNewsService mjNewsService;

    @PostMapping("/queryByPage")
    @ApiOperation(value = "新闻中心_分页查询",response = MjNews.class)
    public ApiResult queryByPage(@RequestBody QueryNewsDto dto){
        return ApiResult.ok(mjNewsService.queryByPage(dto));
    }

    @GetMapping("/detail")
    @ApiOperation(value = "新闻中心_详情",response = MjNews.class)
    public ApiResult detail(@RequestParam("id") Long id){
        return ApiResult.ok(mjNewsService.detail(id));
    }
}

